﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="NoAdmin.aspx.cs" Inherits="Site_SetUp_NoAdmin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="phHead" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phActions" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phSubMenu" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="phMain" Runat="Server">
    <p>Please either select an administrator from the list or select a new one in the using the form bellow.</p>
    <fieldset>
        <legend>Select User</legend>
        <telerik:RadGrid ID="grid" AutoGenerateColumns="false" DataSourceID="dsUsers" Skin="Telerik" runat="server">
            <MasterTableView DataKeyNames="Id,ConcurencyId">
                <Columns>
                    <acms:RadIndexColumn />
                    <telerik:GridBoundColumn DataField="DisplayName" HeaderText="Name" />
                    <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" />
                    <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="Email" />
                    <telerik:GridButtonColumn ButtonType="LinkButton" ItemStyle-CssClass="save" Text="Select" CommandName="SelectUser" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </fieldset>
    <fieldset>
        <legend>Create Admin</legend>
        <asp:Label ID="lblError" Visible="false" CssClass="errorMessage" EnableViewState="false" runat="server">
        </asp:Label>
        <ul class="form">
            <li class="formItem">
                <asp:Label ID="Label1" CssClass="formLabel" Text="First Name<em>*</em>" AssociatedControlID="txtFirstName" runat="server" />
                <span class="formInput">
                    <asp:TextBox ID="txtFirstName" runat="server" />
                    <asp:RequiredFieldValidator ID="valFirstName" ControlToValidate="txtFirstName" ErrorMessage="! Required" Display="Dynamic" ValidationGroup="CreateAdmin" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label2" CssClass="formLabel" Text="Last Name<em>*</em>" AssociatedControlID="txtLastName" runat="server" />
                <span class="formInput">
                    <asp:TextBox ID="txtLastName" runat="server" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtLastName" ErrorMessage="! Required" Display="Dynamic" ValidationGroup="CreateAdmin" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label3" CssClass="formLabel" Text="Email Address<em>*</em>" AssociatedControlID="txtEmail" runat="server" />
                <span class="formInput">
                    <asp:TextBox ID="txtEmail" CssClass="email" runat="server" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtEmail" ErrorMessage="! Required" Display="Dynamic" ValidationGroup="CreateAdmin" runat="server" />
                    <asp:RegularExpressionValidator ID="valEmailFormat" ControlToValidate="txtEmail" ValidationExpression="^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z+])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$" ErrorMessage="! Invalid Email" ValidationGroup="CreateAdmin" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label4" CssClass="formLabel" Text="User Name<em>*</em>" AssociatedControlID="txtUserName" runat="server" />
                <span class="formInput">
                    <asp:TextBox ID="txtUserName" runat="server" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtUserName" ErrorMessage="! Required" Display="Dynamic" ValidationGroup="CreateAdmin" runat="server" />
                    <asp:RegularExpressionValidator ID="valUserNameFormat" ControlToValidate="txtUserName" ValidationExpression="^[a-zA-Z0-9]{1}[a-zA-Z0-9\S]{3,12}[a-zA-Z0-9]{1}$" ValidationGroup="CreateAdmin" ErrorMessage="! Username must be between 5 and 14 characters, must start and end with a alphanumeric character and cannot contain spaces." runat="server" />
                </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label5" CssClass="formLabel" Text="Password<em>*</em>" AssociatedControlID="txtPassword" runat="server" />
                <span class="formInput">
                    <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" />
                    <asp:RequiredFieldValidator ID="valPassword" ControlToValidate="txtPassword" ErrorMessage="! Required" Display="Dynamic" ValidationGroup="CreateAdmin" runat="server" />
                    <asp:RegularExpressionValidator ID="valPasswordFormat" ControlToValidate="txtPassword" ValidationExpression="^[a-zA-Z][\S]{4,13}$" ValidationGroup="CreateAdmin" ErrorMessage="! Password must start with a letter and be between 5 and 14 characters. No spaces are allowed." runat="server" />
                </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label6" CssClass="formLabel" Text="Confirm Password<em>*</em>" AssociatedControlID="txtConfirmPassword" runat="server" />
                <span class="formInput">
                    <asp:TextBox ID="txtConfirmPassword" TextMode="Password" runat="server" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="txtConfirmPassword" ErrorMessage="! Required" Display="Dynamic" ValidationGroup="CreateAdmin" runat="server" />
                    <asp:CompareValidator ID="RequiredFieldValidator6" ControlToValidate="txtConfirmPassword" ControlToCompare="txtPassword" ErrorMessage="! Passwords do not match" Display="Dynamic" ValidationGroup="CreateAdmin" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formInput">
                    <asp:Button ID="btnCreateAdmin" Text="Create Administrator" ValidationGroup="CreateAdmin" runat="server" />
                </span>
            </li>
        </ul>
    </fieldset>
    <acms:UserDataSource ID="dsUsers" runat="server" />    
</asp:Content>

